package com.demo.tran;


import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;


@Service
@RocketMQMessageListener(topic = "TopicTest1234_tran", consumerGroup = "consumer_tran_group" )
public class TransactionConsumer implements RocketMQListener<MessageExt> {


    @Override
    public void onMessage(MessageExt ext) {
        String message = new String(ext.getBody());
        System.out.println("接收到消息: " + message);
    }
}
